<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

<h:head>
<title>Payment</title>
</h:head>
<h:body>
<p:layoutUnit id="top" position="north" size="15%">
		<p:toolbar>
			<p:toolbarGroup align="left">
				<h3><h:link outcome="home.html" value="TravelDream" /></h3>
			</p:toolbarGroup>
			<p:toolbarGroup align="right">

				<h:form>

					<p:commandButton action="#{logoutBean.logout}" value="Logout" />

				</h:form>
				<p:spacer width="10"></p:spacer>

				<p:spacer width="10"></p:spacer>
			</p:toolbarGroup>
		</p:toolbar>
	</p:layoutUnit>
<h3>PAY WHAT YOU WANT FOR WHO YOU WANT!</h3>

<br/>
<br/>
<h:form>  
<p:panel header="OUTBOUND FLIGHT" rendered="#{savedPackageBean.savedPackage.flight1 != -1}">
    <p:dataTable var="OutboundFlight" value="#{savedPackageBean.selectedFlight}" >  
        
        <p:column headerText="Departure Location">  
            <h:outputText value="#{OutboundFlight.depLocation}" />  
        </p:column>  
  
        <p:column headerText="Arrival Location">  
            <h:outputText value="#{OutboundFlight.arrLocation}" />  
        </p:column>  
  
        <p:column headerText="Time">  
            <h:outputText value="#{OutboundFlight.date_Time}" />  
        </p:column>  
  
        <p:column headerText="Price">  
            <h:outputText value="#{OutboundFlight.price}" />  
        </p:column> 
        
     
         
    </p:dataTable>
     
    <br/>
     <br/>
     
    <h:outputText value="" rendered="#{savedPackageBean.savedPackage.flight1 != -1}"/>  
    	<h:outputLabel for="minmax" value="People to pay for: " />  
            <p:spinner id="minmax"   
                    value="#{savedPackageBean.iWantPayFlight}" min="0" max="#{savedPackageBean.savedPackage.flight1ToBeP}"/> 
    </p:panel>
    <br/>
     <br/>
    <p:panel header="RETURN FLIGHT" rendered="#{savedPackageBean.savedPackage.flight2 != -1}">
                    
	<p:dataTable var="ReturnFlight" value="#{savedPackageBean.selectedRetFlight}">  
        
        <p:column headerText="Departure Location">  
            <h:outputText value="#{ReturnFlight.depLocation}" />  
        </p:column>  
  
        <p:column headerText="Arrival Location">  
            <h:outputText value="#{ReturnFlight.arrLocation}" />  
        </p:column>  
  
        <p:column headerText="Time">  
            <h:outputText value="#{ReturnFlight.date_Time}" />  
        </p:column>  
  
        <p:column headerText="Price">  
            <h:outputText value="#{ReturnFlight.price}" />  
        </p:column>  
        
       
     
      
    </p:dataTable>
    
    
    <br/>
     <br/>
     
     
    <h:outputText value="" rendered="#{savedPackageBean.savedPackage.flight2 != -1}" />         
            <h:outputLabel for="minmax" value="People to pay for: " />  
            <p:spinner id="minmax1"   
                    value="#{savedPackageBean.iWantPayRetFlight}" min="0" max="#{savedPackageBean.savedPackage.flight2ToBeP}"/>
   </p:panel>
   <br/>
   <br/>
   <p:panel header="HOTEL" rendered="#{savedPackageBean.savedPackage.hotel != -1}">
   <p:dataTable var="Hotel" value="#{savedPackageBean.selectedHotel}" >
   
   <p:column headerText="Name">  
            <h:outputText value="#{Hotel.name}" />  
        </p:column>  
        
        <p:column headerText="City">  
            <h:outputText value="#{Hotel.city}" />  
        </p:column>  
        
        <p:column headerText="Price">  
            <h:outputText value="#{Hotel.price_Night}" />  
        </p:column>  
   
   
   
     </p:dataTable>
     
     <br/>
     <br/>
     
     <h:outputText value="" rendered="#{savedPackageBean.savedPackage.hotel != -1}"/>       
            <h:outputLabel for="minmax" value="People to pay for: " />  
            <p:spinner id="minmax2"   
                    value="#{savedPackageBean.iWantPayHotel}" min="0" max="#{savedPackageBean.savedPackage.hotToBeP}"/>  
     </p:panel>
     <br/>
     <br/>
      <p:panel header="EXCURSION" rendered="#{!savedPackageBean.selectedExcursionsList.isEmpty()}">
   <p:dataTable var="Excursion" value="#{savedPackageBean.selectedExcursionsList}" >
   
   <p:column headerText="Name">  
            <h:outputText value="#{Excursion.name}" />  
        </p:column>  
        
        <p:column headerText="City">  
            <h:outputText value="#{Excursion.city}" />  
        </p:column>  
        
        <p:column headerText="Price">  
            <h:outputText value="#{Excursion.price}" />  
        </p:column>  
   
   
   
     </p:dataTable>
     
     <br/>
     <br/>
     
     <h:outputText value="" />       
            <h:outputLabel for="minmax" value="People to pay for: " />  
            <p:spinner id="minmax3"   
                    value="#{savedPackageBean.iWantPayExcursions}" min="0" max="#{savedPackageBean.excToBePaid}"/>  
     </p:panel>
     <br/>
     <br/>
     
     <p:panel>
     Would you like to insert your name?
      <br/>
      <br/>
     <p:inputText /> 
     
     </p:panel>
     <br/>
     <br/>
        
     <p:panel>
     
     Would you like to leave a message? Please insert your message here.   
     <br/>
     <br/>
	<p:inputTextarea rows="5" cols="30" queryDelay="750" minQueryLength="1" />  
                            
     
     </p:panel>
     <br/>
     <br/>
	<p:commandButton type="submit" value="Pay" action="#{savedPackageBean.pay()}" />

	
</h:form>  
             
             

</h:body>
</html>